<?php 
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
?>

<?php defined('_JEXEC') or die('Restricted access'); ?>

<script type="text/javascript" language="javascript">
//<![CDATA[
function submitbutton(pressbutton) {
	if (pressbutton == 'cancel') {
		submitform( pressbutton );
		return;
	}
	if ( pressbutton == 'save' || pressbutton == 'apply' ){
		if(form.feed_name.value == '' ){
		    alert('<?php echo JText::_('Feed name could not be empty ')?>');
			form.feed_name.focus();
			return;
		}
		if(form.feed_alias.value == '' ){
		    alert('<?php echo JText::_('Feed alias could not be empty ')?>');
			form.feed_alias.focus();
			return;
		}
		form.task.value= pressbutton;
		form.submit();
//		submitform( pressbutton );
	}					
	else {form.task.value= pressbutton;
	form.submit();
//		submitform( pressbutton );
	}
}
//]]>
</script>
<form action="<?php echo JURI::root();?>index.php" method="post" name="adminForm" id="adminForm" class="adminForm">
	
	<div class="moduletable">
    	<h3><?php echo JText::_('Settings');?></h3>
	<table class="tabledata">
    	<!--<tr>
            <td><?php echo JText::_('Enable'); ?>?</td><td><?php echo $this->lists['renderPublishedList'];?></td>
        </tr>-->
        <tr class="first sectiontableentry1">
            <td><?php echo JText::_('Title');?>:</td>
            <td><input type="text" size="75" maxlength="255" name="feed_name" value="<?php echo($this->name); ?>" /><font color="Red">*</font></td>
        </tr>
        <tr class="sectiontableentry2">
            <td><?php echo JText::_('Alias');?>:</td>
            <td><input type="text" size="75" maxlength="255" name="feed_alias" value="<?php echo($this->alias); ?>" /><font color="Red">*</font></td>
        </tr>
        <tr class="sectiontableentry1">
            <td><?php echo JText::_('Description'); ?>:</td><td><textarea name="feed_description" cols="70" rows="15"><?php echo $this->description; ?></textarea><?php //echo $this->editor->display( 'feed_description',  $this->description, 500, 200, 70, 20, 1, false ) ; ?></td>
        </tr>
        <tr class="sectiontableentry2"><td><?php echo JText::_('Type of Feeds'); ?>:</td><td><?php echo $this->lists['rssTypeList']; ?></td>
        </tr>
        <tr class="sectiontableentry1">
            <td><?php echo JText::_('Number Itmes'); ?>: </td><td><input type="text" size="3" maxlength="3" name="msg_count" value="<?php echo $this->count; ?>" /></td>
        </tr> 
        <tr class="sectiontableentry2">
            <td><?php echo JText::_('Order By'); ?>:</td><td><?php echo $this->lists['orderingList']; ?></td>
        </tr>
        <?php /*>> MAD 2007/10/10 */  ?>
        <tr class="sectiontableentry1">
            <td><?php echo JText::_('Max chars'); ?>:</td><td><?php echo $this->lists['numWordsList']; ?></td>
        </tr>
        <?php /*<< MAD 2007/10/10 */  ?>
        <tr class="sectiontableentry1">
            <td><?php echo JText::_('Author Contact'); ?>:</td><td><?php echo $this->lists['renderAuthorList']; ?></td>
        </tr>
        <tr class="sectiontableentry2">
            <td><?php echo JText::_('Cache Times'); ?>:</td><td><input type="text" size="10" maxlength="10" name="feed_cache" value="<?php echo $this->cache; ?>" /></td>
        </tr>
        
        
        <?php /*>> AGE 2007/09/25 */  ?>
        <!--<tr>
            <td>Excluded Categorie(s)</td><td><?php echo $this->lists['excludedcatlist'];?></td>
        </tr>-->
        
        <!--<tr class="sectiontableentry1">
            <td><?php echo JText::_('Feed image'); ?>:</td>
            <td>
                <input onchange="loadImg(this)" type="text" size="20" name="feed_imgUrl" value="<?php echo $this->imgUrl; ?>" />&nbsp;[Tab] to preview or leave blank to leave out image details from feed
            </td>
        </tr>
        <tr class="sectiontableentry2">
            <td><?php echo JText::_('Feed button'); ?>:</td>
            <td><?php echo($this->lists['feedButtons']);?>&nbsp;
                <img id="feedButton" src="<?php echo (JURI::root() . "components/com_jajobboard/views/jafeeds/images/buttons/" . $this->BtnImgUrl); ?>" />
            </td>
        </tr>
        <tr class="last sectiontableentry1">
            <td >&nbsp;</td><td valign="top"><?php echo JText::_('Image Preview'); ?>:<br /> <img id="feedImg" src="<?php echo $this->imgUrl; ?>" /></td>
        </tr>-->
        
       	
        	
        
    </table>
   </div>
   <div class="moduletable">
     	<h3><?php echo JText::_('Categories and Locations Filters'); ?></h3>
    	<table class="tabledata">
    		<tr class="first sectiontableentry1">
            	<td><?php echo JText::_('Category(s)');?>:</td><td><?php echo $this->lists['filter_cat_id'];?></td>
        	</tr>
        	<tr class="sectiontableentry2">
            	<td><?php echo JText::_('Location(s)');?>:</td><td><?php echo $this->lists['filter_location_id'];?></td>
        	</tr>
        	<tr class="sectiontableentry1">
        		<td><?php echo JText::_('Zip code'); ?>:</td><td><input type="text" name="filter_zipcode" value="<?php echo $this->feed->filter_zipcode; ?>" /></td> 
        	</tr>
        	<tr class="sectiontableentry1">
        		<td><?php echo JText::_('Publish date (days)'); ?>:</td><td><input type="text" name="filter_date" value="<?php echo $this->feed->filter_date; ?>" /><?php echo JText::_('days ago'); ?><small><?php echo "<br />".JText::_('Eg: if the value is 5, only jobs published in the last 5 days is listed')."<br />".JText::_("If value equals to -1, all jobs irrespective of effected date will be filtered out"); ?></small></td> 
        	</tr>
        	<tr class="last sectiontableentry2">
            	<td><?php echo JText::_('Only premium jobs');?>?</td>
            	<td>
            		<input onclick="update_is_premium(this.value)" type="radio" name="check_is_premium" value="0" <?php echo ($this->feed->filter_is_premium==0)?'checked="true"':'';?> /><?php echo JText::_('No');?>
            		<input onclick="update_is_premium(this.value)" type="radio" name="check_is_premium" value="1" <?php echo ($this->feed->filter_is_premium==1)?'checked="true"':'';?> /><?php echo JText::_('Yes');?>
            	</td>
        	</tr>
        	
    	</table>
    </div>
    <div class="moduletable">
    	<h3><?php echo JText::_('Special Filter'); ?></h3>
    	<table class="tabledata">
    		<tr class="first sectiontableentry1">
            <td><?php echo JText::_('Excluded Job ID(s)'); ?>:</td>
            <td>
                <textarea name="filter_exitems" cols="30" rows="3" ><?php echo $this->exitems; ?></textarea>
                <br /><?php echo JText::_('Enter job id(s) you want to exclude.'); ?>
                <br /><?php echo JText::_('Seperate id with a ",".'); ?> <br /><?php echo JText::_('Example: 1, 2, 3, 4, 5, 6'); ?>
            </td>
            <tr class="sectiontableentry2">
            <td><?php echo JText::_('Excluded Employer ID(s)'); ?>:</td>
            <td>
                <textarea name="filter_exemployers" cols="30" rows="3" ><?php echo $this->exemployers; ?></textarea>
                <br /><?php echo JText::_('Enter employer id(s) you want to exclude.'); ?>
                <br /><?php echo JText::_('Seperate id with a ",".'); ?> <br /><?php echo JText::_('Example: 1, 2, 3, 4, 5, 6'); ?>
            </td>
            <tr class="last sectiontableentry1">
            <td><?php echo JText::_('Included Employer ID(s)'); ?>:</td>
            <td>
                <textarea name="filter_inemployers" cols="30" rows="3" ><?php echo $this->inemployers; ?></textarea>
                <br /><?php echo JText::_('Enter employer id(s) you want to include.'); ?>
                <br /><?php echo JText::_('Seperate id with a ",".'); ?> <br /><?php echo JText::_('Example: 1, 2, 3, 4, 5, 6'); ?>
            </td>
        </tr>
    	</table>
    </div>
    <input class="button" type="button" onclick="submitbutton('save');" value="<?php echo JText::_('Save'); ?>" />
 	<input class="button" type="button" onclick="submitbutton('cancel');" value="<?php echo JText::_('Cancel'); ?>" />
    <input type="hidden" name="filter_is_premium" value="<?php echo $this->feed->filter_is_premium;?>" />
    <input type="hidden" name="id" value="<?php echo $this->id;?>" />
    <input type="hidden" name="cid[]" value="<?php echo $this->id;?>" />
    <input type="hidden" name="option" value="com_jajobboard" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="view" value="jafeeds" />
    <input type="hidden" name="Itemid" value="1000" />
    <input type="hidden" name="published" value="1" />
    <input type="hidden" name="is_user" value="<?php echo (isset($this->is_user))?$this->is_user:1; ?>" ?>
    <?php echo JHTML::_( 'form.token' ); ?>
</form>
<script type="text/javascript">		
	
	function update_is_premium(value)
	{
		form = document.adminForm;
		form.filter_is_premium.value = value;
	}
    
</script>